From Cppreference
|
|
| basic_ostream& seekp( pos_type pos );
|
|
|
|
|
|
basic_ostream& seekp( off_type& off, std::ios_base::seekdir dir);
|
|
|
|
|
|
Sets output position indicator of the current associated streambuf object. In case of failure, calls setstate(std::ios_base::failbit).
1) sets the output position indicator to absolute (relative to the beginning of the file) value pos. Specifically calls rdbuf()->pubseekpos(pos, std::ios_base::out).
2) sets the output position indicator to position off, relative to position, defined by dir. Specifically rdbuf()->pubseekoff(off, dir, std::ios_base::out).
Parameters
| pos
| -
| absolute position to set the output position indicator to.
|
| off
| -
| relative position to set the output position indicator to.
|
| dir
| -
| defines base position to apply the relative offset to. It can be one of the following constants:
|
|
| Constant
| Explanation
|
|
|
| beg
| the beginning of a stream
|
|
|
| end
| the ending of a stream
|
|
|
| cur
| the current position of stream position indicator
|
|
Return value
*this
Example
See also
|
|
|
| returns the output position indicator (public member function)
|
|
|
|
| returns the input position indicator (public member function of std::basic_istream)
|
|
|
|
| sets the input position indicator (public member function of std::basic_istream)
|